import { ChangeDetectionStrategy, Component } from '@angular/core';
import { MessageboxService } from '@iux/live';

@Component({
  templateUrl: './confirm.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ConfirmComponent {
  constructor(private messageBox: MessageboxService) {}

  confirm(): void {
    this.messageBox.confirm({ lvContent: 'This is a confirm dialog.', lvModalKey: 'myModal' });
  }

  warningConfirm(): void {
    this.messageBox.confirm({
      lvDialogIcon: 'lv-icon-status-warning-info',
      lvContent: 'This is a warning confirm dialog.',
      lvModalKey: 'myModal',
    });
  }

  dangerConfirm(): void {
    this.messageBox.confirm({
      lvDialogIcon: 'lv-icon-status-danger',
      lvContent: 'This is a danger confirm dialog.',
      lvOkType: 'primary',
      lvCancelType: 'default',
      lvModalKey: 'myModal',
    });
  }
}
